var cw = require("../components/winLocation.js");

var FS;
var mapList = {
    "bandCard":{
        "title":"银行卡认证",
        "imgName":"yinhangka_icon2.png"
    },
    "zxxt":{
        "title":"征信系统认证",
        "imgName":"zhengxin_icon2.png"
    },
    "xlrz":{
        "title":"学历认证",
        "imgName":"xuelirenzheng_icon2.png"
    },
    "sbrz":{
        "title":"社保认证",
        "imgName":"shejiao_icon2.png"
    },
    "sjrz":{
        "title":"社交认证",
        "imgName":"shebao_icon2.png"
    },
    "yysrz":{
        "title":"运营商认证",
        "imgName":"yunyingshang_icon2.png"
    },
    "txlrz":{
        "title":"通讯录认证",
        "imgName":"tongxunlu_icon2.png"
    },
    "xykrz":{
        "title":"信用卡账单认证",
        "imgName":"xinyongka_icon2.png"
    },
    "gzdwrz":{
        "title":"工作单位认证",
        "imgName":"gongzuodanwei_icon2.png"
    }
    
};
$(document).on("pageinit", "#bindPage", controllerInit);

function controllerInit () {
    cw.QueryString.Initial();
    initValue();
    changeImgName();
    bindEvent();
}

// 初始化变量
function initValue () {
    FS = cw.QueryString.GetValue("fsName");
}

// 修改图片和功能名称
function changeImgName () {
    var imgUrl = mapList[FS].imgName;
    var fsName = mapList[FS].title;
    $("#fsimg").attr("src","../images/faceDetect/" + imgUrl);
    $("#bind_name").text(fsName);
}

// 绑定事件
function bindEvent() {
    $("#fanhui").on("click",function  () {
        window.history.back(); 
    });
    $("#go_back").on("click",function  () {
        window.history.back(); 
    });
}